package com.apedad.example.service.impl;

import com.apedad.example.annotation.TargetDataSource;
import com.apedad.example.annotation.TargetDataSourceParam;
import com.apedad.example.dao.UserInfoMapper;
import com.apedad.example.entity.UserInfo;
import com.apedad.example.service.UserInfoService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0
 */
@Service("userInfoService")
public class UserInfoServiceImpl implements UserInfoService {
    private static final Logger LOG = Logger.getLogger(UserInfoServiceImpl.class);
    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public List<UserInfo> listAll(@TargetDataSourceParam String dataSource) {
        return userInfoMapper.listAll(dataSource);
    }

    @Override
    public List<UserInfo> listAll() {
        return userInfoMapper.listAll();
    }


    @Override
    public int insert(UserInfo userInfo) {
        return userInfoMapper.insert(userInfo);
    }
}
